home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / netdb.h,v < prev    next >
Encoding:
Text File  |  1989-06-23  |  2.9 KB  |  130 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     89.06.23.11.30.28;  author rab;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     88.06.29.14.57.58;  author ouster;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     88.06.21.17.23.01;  author ouster;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 1.3
  30. log
  31. @*** empty log message ***
  32. @
  33. text
  34. @/*
  35.  * Copyright (c) 1980,1983,1988 Regents of the University of California.
  36.  * All rights reserved.
  37.  *
  38.  * Redistribution and use in source and binary forms are permitted
  39.  * provided that this notice is preserved and that due credit is given
  40.  * to the University of California at Berkeley. The name of the University
  41.  * may not be used to endorse or promote products derived from this
  42.  * software without specific prior written permission. This software
  43.  * is provided ``as is'' without express or implied warranty.
  44.  *
  45.  *    @@(#)netdb.h    5.9 (Berkeley) 4/5/88
  46.  */
  47.  
  48. #ifndef _NETDB
  49. #define _NETDB
  50.  
  51. /*
  52.  * Structures returned by network
  53.  * data base library.  All addresses
  54.  * are supplied in host order, and
  55.  * returned in network order (suitable
  56.  * for use in system calls).
  57.  */
  58. struct    hostent {
  59.     char    *h_name;    /* official name of host */
  60.     char    **h_aliases;    /* alias list */
  61.     int    h_addrtype;    /* host address type */
  62.     int    h_length;    /* length of address */
  63.     char    **h_addr_list;    /* list of addresses from name server */
  64. #define    h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  65. };
  66.  
  67. /*
  68.  * Assumption here is that a network number
  69.  * fits in 32 bits -- probably a poor one.
  70.  */
  71. struct    netent {
  72.     char        *n_name;    /* official name of net */
  73.     char        **n_aliases;    /* alias list */
  74.     int        n_addrtype;    /* net address type */
  75.     unsigned long    n_net;        /* network # */
  76. };
  77.  
  78. struct    servent {
  79.     char    *s_name;    /* official service name */
  80.     char    **s_aliases;    /* alias list */
  81.     int    s_port;        /* port # */
  82.     char    *s_proto;    /* protocol to use */
  83. };
  84.  
  85. struct    protoent {
  86.     char    *p_name;    /* official protocol name */
  87.     char    **p_aliases;    /* alias list */
  88.     int    p_proto;    /* protocol # */
  89. };
  90.  
  91. struct hostent    *gethostbyname(), *gethostbyaddr(), *gethostent();
  92. struct netent    *getnetbyname(), *getnetbyaddr(), *getnetent();
  93. struct servent    *getservbyname(), *getservbyport(), *getservent();
  94. struct protoent    *getprotobyname(), *getprotobynumber(), *getprotoent();
  95.  
  96. /*
  97.  * Error return codes from gethostbyname() and gethostbyaddr()
  98.  * (left in extern int h_errno).
  99.  */
  100.  
  101. #define    HOST_NOT_FOUND    1 /* Authoritative Answer Host not found */
  102. #define    TRY_AGAIN    2 /* Non-Authoritive Host not found, or SERVERFAIL */
  103. #define    NO_RECOVERY    3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  104. #define    NO_DATA        4 /* Valid name, no data record of requested type */
  105. #define    NO_ADDRESS    NO_DATA        /* no address, look for MX record */
  106.  
  107. #endif /* _NETDB */
  108. @
  109.  
  110.  
  111. 1.2
  112. log
  113. @Add ifdefs so that file can't be processed twice.
  114. @
  115. text
  116. @d74 1
  117. a74 1
  118. #endif _NETDB
  119. @
  120.  
  121.  
  122. 1.1
  123. log
  124. @Initial revision
  125. @
  126. text
  127. @d15 3
  128. d73 2
  129. @
  130.